package service_join

import (
	join_db "hft/Database/admin/join"
	"hft/Http/Models/dao"
	types_join "hft/Http/Services/join/types"
	utils "hft/Http/Utils"
	"hft/global"
)

type Join struct{}

func (*Join) List(paginate *types_join.JoinParams) utils.Page {
	var list []*join_db.Join
	global.OC_DB.Scopes(dao.Paginate(dao.Page(paginate.Page), global.OC_DB)).Find(&list).Scopes(dao.GetCount(global.OC_DB)).Count(&paginate.Total)
	paginate.Data = list
	return paginate.Page
}

var JoinService = new(Join)
